<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;

use Mail;
use Illuminate\Mail\Message;
class SendFangownerMail implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
    protected $model;
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($model)
    {
        $this->model = $model;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $fangowner = $this->model;
        Mail::raw("恭喜您在本平台添加成功，我们后续为您服务!!!!",function(Message $message) use ($fangowner){
            $message->to($fangowner->email,$fangowner->name);
            $message->subject("添加成功通知");
        });
    }
}
